import time
from time import sleep

from selenium import webdriver
from selenium.webdriver.common.by import By

driver=webdriver.Firefox()
# driver.maximize_window()
driver.get('file:///C:/Users/lenovo/Downloads/prompt.html')
driver.find_element(By.ID,'button').click()
sleep(3)
alert=driver.switch_to.alert
alert.send_keys('prompt弹窗')
time.sleep(2)
# alert.accept()
alert.dismiss()
time.sleep(5)
driver.quit()

